<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="lg" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="lg2"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html class="x-admin-sm">
    
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/font.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript"src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/lib/layui/layui.js" charset="utf-8"></script>

    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/xadmin.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/cookie.js"></script>
</head>
    <body >
        <div class="layui-fluid" >
            <div class="layui-row">
                <form class="layui-form">
                  <div class="layui-form-item">
                      <label for="username" class="layui-form-label">
                          	培训名称
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" lay-verify="class_name" autocomplete="off" class="layui-input" id="train_place" placeholder="培训名称" name="class_name">
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label for="username" class="layui-form-label">
                          	培训地点
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" lay-verify="train_place" autocomplete="off" class="layui-input" id="train_place" placeholder="培训地点" name="train_place">
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label for="phone" class="layui-form-label">
                          	培训机构
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" lay-verify="organizer"
                          autocomplete="off" class="layui-input" id="organizer" placeholder="培训部门" name="organizer">
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label for="L_email" class="layui-form-label">
                          	培训费用
                      </label>
                      <div class="layui-input-inline">
                           <input type="text" lay-verify="train_fee"
                          autocomplete="off" class="layui-input" id="train_fee" placeholder="培训费用" name="train_fee">
                      </div>
                  </div>
				  <div class="layui-form-item">
				    <div class="layui-inline">
				      <label class="layui-form-label">开始日期</label>
				      <div class="layui-input-inline">
				        <input type="text" class="layui-input" id="train_start" placeholder="开始日期" name="train_start" >
				      </div>
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <div class="layui-inline">
				      <label class="layui-form-label">结束日期</label>
				      <div class="layui-input-inline">
				        <input type="text" class="layui-input" id="train_end" placeholder="结束日期" name="train_end" >
				      </div>
				    </div>
				  </div>
                  <div class="layui-form-item">
                      <label for="L_repass" class="layui-form-label">
                      </label>
                      <input type="hidden" value="${plan.plan_id }" name="plan_id">
                      <button  class="layui-btn" lay-filter="add" lay-submit>完成</button>
                  </div>
              </form>
            </div>
        </div>
        <script>
        layui.use('laydate', function(){
        	  var laydate = layui.laydate;
        	  
        	  //执行一个laydate实例
        	  laydate.render({
        	    elem: '#train_start' //指定元素
        	  });
        	  laydate.render({
        	    elem: '#train_end' //指定元素
        	  });
        	});
        layui.use(['form', 'layer'],
            function() {
	        	$ = layui.jquery;
	            var form = layui.form,
	            layer = layui.layer;
                //监听提交
                form.on('submit(add)',
                function(data) {
                    console.log(data);
                    $.ajax({
                    	url:"${pageContext.request.contextPath}/train/savePlan",
                    	data:data.field,
                    	success:function(data){
                    		
                    	}
                    })
                    //发异步，把数据提交给php
                    layer.alert("添加成功", {
                        icon: 6
                    },
                    function() {
                        //关闭当前frame
                        x_admin_close();
                        x_admin_father_reload();
                    });
                    return false;
                });

            });</script>
        <script>var _hmt = _hmt || []; (function() {
                var hm = document.createElement("script");
                hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })();</script>
    </body>

</html>
